﻿<UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit" xmlns:local="clr-namespace:KnowledgeKiosk" xmlns:ee="http://schemas.microsoft.com/expression/2010/effects"
             xmlns:converter="clr-namespace:KnowledgeKiosk.Converters"
	x:Class="KnowledgeKiosk.MainPage" FontFamily="Verdana" mc:Ignorable="d" FontSize="18"
	Width="1200" Height="1920" DataContext="{Binding RelativeSource={RelativeSource Self}}">
	<UserControl.Resources>
		<ResourceDictionary>
			<ResourceDictionary.MergedDictionaries>
				<ResourceDictionary Source="Themes/BrightBlue.xaml"/>
			</ResourceDictionary.MergedDictionaries>
            <converter:DegreeToDirectionConverter x:Key="degreeToDirectionConverter"/>
		</ResourceDictionary>        
	</UserControl.Resources>
	<Canvas>
		<Canvas x:Name="_BackgroundLayer" Background="{StaticResource CurvesBackground}" HorizontalAlignment="Left" Height="1920" UseLayoutRounding="False" VerticalAlignment="Top" Width="1200">
			<Canvas x:Name="_Curves" Height="962.253" Canvas.Left="-0.189" Canvas.Top="960.001" Width="1201.596">
					<Path Data="M983.66107,960.00098 L1199.9991,960.00098 L1202.5023,960.5 C1199.8733,1029.9829 1203.9191,1106.8057 1203.1691,1178.1666 L984.73566,1176.9844 C989.86768,1366.0364 1027.4458,1535.615 1089.2518,1671.75 C1026.3878,1677.619 961.38696,1682.152 901.00098,1690.5 C866.22894,1543.923 855.64008,1355.2841 864.22412,1176.339 L983.70441,1176.375 C983.11646,1105.51 980.95209,1030.4399 983.66107,960.00098" Height="730.499" Canvas.Left="861.584" Stretch="Fill" Canvas.Top="0" Width="341.866" Fill="{StaticResource CurvesLight}"/>
					<Path Data="M1202.5001,1176.4999 L1201.1251,1665.9999 C1164.326,1669.0128 1124.1569,1667.5939 1087.2499,1670.4999 C1025.4448,1534.3639 988.79865,1365.0519 983.66669,1175.9999 z" Height="494.5" Canvas.Left="983.731" Stretch="Fill" Canvas.Top="215.999" Width="218.833" Fill="{StaticResource CurvesMedium}"/>
					<Path Data="M1201.25,1661.6873 L1201,1664.4998 L1201.375,1853.6248 C1152.1249,1816.2914 1106.4581,1736.1248 1085.2498,1670.3748 C1122.1567,1667.4688 1163.5759,1664.5138 1200.375,1661.4998" Height="192.125" Canvas.Left="1085.314" Stretch="Fill" Canvas.Top="701.374" Width="116.125" Fill="{StaticResource CurvesDark}"/>
					<Path Data="M1198.873,1663.0996 L1199.999,1663.0996 L1201.1196,1853.5244 C1200.7498,1873.749 1203.7487,1902.5881 1202.9998,1925.124 L984,1927.6239 C948.24597,1857.839 920.98999,1773.8436 900.28101,1689.0146 C960.66699,1680.6666 1024.459,1675.7275 1087.323,1669.8596 C1117.2209,1735.7406 1156.109,1804.6376 1198.873,1850.1416 z" Height="264.525" Canvas.Left="900.47" Stretch="Fill" Canvas.Top="702.974" Width="302.84" Fill="{StaticResource CurvesMedium}"/>
					<Path Data="M901.00031,1688.666 C921.70929,1773.495 948.24628,1855.7146 984.00031,1925.4995 L-11.9997,1924.9995 L-11.4997,1871.9994 C268.32327,1791.9883 578.724,1726.0453 901.16699,1688.6664" Height="236.833" Canvas.Left="-11.311" Stretch="Fill" Canvas.Top="728.666" Width="996" Fill="{StaticResource CurvesLight}"/>
			</Canvas>
			<Canvas x:Name="_InfoSupportLogo" Height="93.41" Canvas.Left="50" Canvas.Top="50" Width="361.641">
				<Canvas.Effect>
					<DropShadowEffect BlurRadius="0" ShadowDepth="2" Color="Black"/>
				</Canvas.Effect>
				<Path Data="M106.1641,66.5767000000001C105.3931,72.0857000000001,103.8141,76.7867000000001,102.8881,82.1397000000001L86.9141,82.1397000000001C88.0821,77.0277000000001,89.3881,72.0537000000001,90.1911,66.5767000000001z" Fill="{StaticResource CurvesForeground}" Height="15.563" Canvas.Left="39.727" Stretch="Fill" Canvas.Top="0.44" Width="19.25"/>
				<Path Data="M408.8286,66.5767000000001C408.1766,71.7947000000001,406.6146,76.1027000000001,405.9616,81.3207000000001L233.9466,81.3207000000001C225.6296,81.3207000000001,216.1826,80.1147000000001,210.1926,82.1397000000001C206.0446,83.5417000000001,202.0556,87.7007000000001,201.5916,91.9697000000001C200.9386,97.9717000000001,204.8706,102.3477,206.0966,107.5327C210.4116,125.7907,199.2846,142.2037,186.4376,148.0787C179.1776,151.3997,167.8026,150.5367,156.1306,150.5367L91.4196,150.5367C92.0736,145.1827,93.6566,140.7597,94.2866,135.3827L156.9496,135.3827C163.5386,135.3827,172.8316,136.2707,178.2466,134.5637C184.1046,132.7177,189.1026,127.5797,190.5336,121.8677C192.6616,113.3747,187.7956,107.0537,186.4376,99.3417000000001C183.6126,83.3017000000001,195.2496,68.3117000000001,208.9636,66.5767000000001C216.7926,65.5867000000001,225.5076,66.5767000000001,233.9466,66.5767000000001z" Fill="{StaticResource CurvesForeground}" Height="84.501" Canvas.Left="44.232" Stretch="Fill" Canvas.Top="0" Width="317.409"/>
				<Path Data="M155.311,80.9115999999999C155.5,83.2845999999999,154.629,84.5975999999999,154.492,86.6445999999999C147.534,85.2845999999999,147.101,90.4485999999999,146.301,95.2455999999999C147.54,96.1905999999999,150.525,95.3905999999999,152.444,95.6555999999999C152.412,97.5345999999999,151.404,98.4375999999999,151.625,100.5706L145.482,100.5706C142.653,110.7106,140.613,121.6406,138.519,132.5156L131.966,132.5156C134.435,122.1506,136.342,111.2256,138.929,100.9796C137.96,100.0376,135.253,100.8326,133.605,100.5706C134.191,99.1095999999999,134.31,97.1795999999999,134.833,95.6555999999999L139.338,95.6555999999999C141.582,91.9305999999999,140.874,87.1935999999999,143.434,84.1875999999999C145.918,81.2695999999999,149.69,80.8745999999999,155.311,80.9115999999999" Fill="{StaticResource CurvesForeground}" Height="51.606" Canvas.Left="84.778" Stretch="Fill" Canvas.Top="14.773" Width="23.372"/>
				<Path Data="M102.478,84.5977C97.187,109.4777,92.064,134.5247,86.915,159.5467L71.352,159.5467C76.487,134.5117,81.156,109.0097,86.915,84.5977z" Fill="{StaticResource CurvesForeground}" Height="74.949" Canvas.Left="24.164" Stretch="Fill" Canvas.Top="18.461" Width="31.126"/>
				<Path Data="M405.1426,84.5977C404.6746,88.2247,403.6856,91.3317,403.0946,94.8367C404.1986,95.7797,407.0446,94.9817,408.8286,95.2457C408.8486,97.1767,408.1096,98.3487,408.0096,100.1607L402.2756,100.1607C400.1386,108.2707,397.5476,118.0837,396.9516,126.3717C397.6096,127.7617,399.8096,127.6097,401.8666,127.6007C402.0876,129.7337,401.0796,130.6367,401.0466,132.5157C397.0806,132.8477,393.2126,133.3477,390.8076,131.2867C389.2556,120.9647,394.1986,110.4997,395.7226,100.5707C394.7326,99.7857,392.4316,100.3117,390.8076,100.1607C390.7346,98.1757,391.3486,96.8777,391.6276,95.2457L396.1326,95.2457C398.0126,92.6207,397.8476,87.9507,398.9986,84.5977z" Fill="{StaticResource CurvesForeground}" Height="48.223" Canvas.Left="343.322" Stretch="Fill" Canvas.Top="18.461" Width="18.319"/>
				<Path Data="M260.5679,101.7988C257.3599,104.1548,250.1619,118.3668,254.8349,125.1438C257.7759,129.4098,265.7459,128.0578,268.7589,125.5528C274.6679,120.6428,281.4389,96.8848,265.0729,100.1598C262.9739,100.5808,261.7289,100.9458,260.5679,101.7988 M251.5579,128.8298C249.9119,134.6928,248.8279,141.1168,247.4619,147.2598L241.3189,147.2598C244.7889,129.7058,248.5559,112.4488,252.3769,95.2458L258.1109,95.2458C257.9939,96.9038,257.4079,98.0918,257.2919,99.7508C260.4279,95.9368,270.7549,91.5048,277.3599,96.0648C279.3099,97.4108,281.4169,101.1358,281.8649,104.2568C283.8349,117.9598,272.9179,135.5258,257.2919,133.3348C255.1109,133.0288,253.3549,130.8488,251.5579,128.8298" Fill="{StaticResource CurvesForeground}" Height="53.131" Canvas.Left="194.131" Stretch="Fill" Canvas.Top="27.992" Width="40.776"/>
				<Path Data="M295.79,105.8945C291.207,113.2575,289.314,132.3325,303.981,127.6015C306.741,126.7105,310.502,122.2485,312.172,117.7715C313.517,114.1675,315.469,106.5585,312.992,102.6175C311.341,99.9925000000001,307.269,99.5445000000001,303.981,100.1605C300.138,100.8805,297.481,103.1775,295.79,105.8945 M290.466,128.4195C288.387,134.1225,287.801,141.3185,285.96,147.2595L279.817,147.2595C283.513,129.9315,287.275,112.6695,290.875,95.2465000000001L296.609,95.2465000000001C296.623,97.0345000000001,296.254,98.4395000000001,295.79,99.7505000000001C299.552,95.9495000000001,308.355,91.9855000000001,314.63,95.2465000000001C328.818,102.6175,316.635,136.9495,296.2,133.3345C293.777,132.9065,291.525,131.3055,290.466,128.4195" Fill="{StaticResource CurvesForeground}" Height="53.221" Canvas.Left="232.629" Stretch="Fill" Canvas.Top="27.902" Width="40.951"/>
				<Path Data="M336.3369,102.2085C331.2279,106.5295,324.9629,126.2055,336.3369,128.0105C352.6059,130.5935,359.5509,98.3755,343.2989,99.7505C339.7429,100.0525,338.1039,100.7135,336.3369,102.2085 M343.2989,94.4265C352.9609,93.3665,359.1909,98.6665,359.2719,108.3515C359.3829,121.6795,347.8149,135.5235,333.8789,133.3345C328.0679,132.4225,323.5199,126.7145,323.2309,119.8195C322.6779,106.6325,331.7819,95.6905,343.2989,94.4265" Fill="{StaticResource CurvesForeground}" Height="39.271" Canvas.Left="276.019" Stretch="Fill" Canvas.Top="28.156" Width="36.066"/>
				<Path Data="M385.4839,94.0175999999999C385.4129,96.6765999999999,384.6729,98.6675999999999,384.2549,100.9796C366.2499,99.7655999999999,370.2099,120.5176,365.4159,132.5156L359.2719,132.5156C361.8649,120.0926,364.8269,108.0366,367.0539,95.2465999999999L373.1969,95.2465999999999C372.7009,97.0705999999999,372.4639,99.1545999999999,371.9679,100.9796C374.8489,98.6705999999999,378.4339,93.5205999999999,385.4839,94.0175999999999" Fill="{StaticResource CurvesForeground}" Height="38.532" Canvas.Left="312.084" Stretch="Fill" Canvas.Top="27.847" Width="26.212"/>
				<Path Data="M125.8228,132.5156L119.2698,132.5156C120.3458,125.0926,123.7808,116.2266,124.5938,108.7616C125.2698,102.5586,123.3168,99.0766,116.4028,100.1606C104.5558,102.0176,104.4928,121.7646,101.6588,132.5156L95.1058,132.5156C97.8438,120.3726,100.6368,108.2856,102.8878,95.6556L109.0308,95.6556C108.7618,97.1606,108.2358,98.4096,108.2118,100.1606C111.6468,96.2896,122.0888,91.7786,128.2808,96.0646C134.2888,100.2246,130.2128,109.9856,128.6898,117.3626C127.5478,122.8946,126.7558,127.9656,125.8228,132.5156" Fill="{StaticResource CurvesForeground}" Height="38.191" Canvas.Left="47.918" Stretch="Fill" Canvas.Top="28.188" Width="36.353"/>
				<Path Data="M152.8535,115.3145C151.9335,122.8165,154.4215,127.7105,159.4065,128.4195C169.0605,129.7955,176.9635,117.9305,175.3795,107.1235C174.6465,102.1235,170.6515,99.3314999999999,165.1405,100.1605C157.4825,101.3135,153.6585,108.7595,152.8535,115.3145 M165.1405,94.8364999999999C185.6135,91.8484999999999,185.5365,116.8815,174.1505,128.0105C165.3235,136.6395,148.5045,135.5435,146.3005,123.5055C143.8075,109.8865,153.7335,96.5015,165.1405,94.8364999999999" Fill="{StaticResource CurvesForeground}" Height="39.06" Canvas.Left="98.726" Stretch="Fill" Canvas.Top="28.454" Width="35.917"/>
				<Path Data="M223.7075,95.2461000000001C223.0455,99.6791000000001,221.9345,104.4421,220.8405,109.5801C219.7735,114.5951,216.3355,123.5401,219.6125,126.7821C221.5605,128.7091,225.6845,128.2011,227.8035,127.6011C238.7315,124.5081,238.0465,106.0851,241.3185,95.2461000000001L247.4615,95.2461000000001C245.2355,108.0371,242.2735,120.0921,239.6805,132.5161L233.9465,132.5161C233.9265,130.5841,234.6655,129.4131,234.7665,127.6011C232.6565,128.1041,231.8865,130.7261,229.0325,132.1061C222.1075,135.4541,212.0915,133.1131,211.4205,125.9631C211.0165,121.6491,213.1875,115.9411,214.2875,110.8091C215.4725,105.2801,216.5745,100.3781,217.5635,95.2461000000001z" Fill="{StaticResource CurvesForeground}" Height="38.361" Canvas.Left="164.183" Stretch="Fill" Canvas.Top="29.109" Width="36.09"/>
				<Path Data="M73.8086,135.3828C72.5646,140.2808,71.6586,145.5198,70.5326,150.5368L47.1876,150.5368C47.7076,145.0498,49.2746,140.6098,50.0546,135.3828z" Fill="{StaticResource CurvesForeground}" Height="15.154" Canvas.Left="0" Stretch="Fill" Canvas.Top="69.246" Width="26.621"/>
			</Canvas>
		</Canvas>
		<StackPanel x:Name="_MainContent" Canvas.Left="50" Canvas.Top="150" Width="1100">
			<TextBlock x:Name="_CoursesHeader" Text="Lokaalbezetting" Style="{StaticResource TextBlockHeaderStyle}"/>
			<ItemsControl x:Name="coursesItemsControl" ItemsSource="{Binding CourseCollection, Source={StaticResource CourseData}}" Foreground="{StaticResource BorderForeground}">
				<ItemsControl.ItemTemplate>
					<DataTemplate>
						<Border Style="{StaticResource RoundedBorderStyleOuter}">
							<Border Style="{StaticResource RoundedBorderStyleInner}">
								<Grid Height="175">
									<Grid.ColumnDefinitions>
										<ColumnDefinition Width="100"/>
										<ColumnDefinition/>
										<ColumnDefinition Width="Auto"/>
									</Grid.ColumnDefinitions>
									<StackPanel Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Center">
										<TextBlock Text="{Binding Room}" FontSize="50" TextAlignment="Center" FontFamily="Arial Black" TextWrapping="Wrap" LineStackingStrategy="BlockLineHeight" LineHeight="48"/>
										<TextBlock Text="Lokaal" TextAlignment="Center" />
									</StackPanel>
									<TextBlock Text="{Binding Title}" FontSize="24" TextWrapping="Wrap" Grid.Column="1" VerticalAlignment="Center" LineHeight="32"/>
									<Image x:Name="trainerImage" Source="{Binding Trainer.Url}" 
										VerticalAlignment="Center" Margin="5" Grid.Column="2" MaxWidth="150"
										ImageOpened="TrainerImage_Loaded" SizeChanged="TrainerImage_Loaded">
										<!--
										<Image.Effect>
											<ee:ColorToneEffect LightColor="White" DarkColor="#FF01426E" Desaturation="1" ToneAmount="1"/>
										</Image.Effect>
										-->
									</Image>
                                    <TextBlock Text="{Binding Trainer.Name}" Grid.Column="1" VerticalAlignment="Bottom" HorizontalAlignment="Right" TextWrapping="Wrap" Margin="0,0,5,5" TextAlignment="Right" FontStyle="Italic"/>
								</Grid>
							</Border>
						</Border>
					</DataTemplate>
				</ItemsControl.ItemTemplate>
				<ItemsControl.ItemsPanel>
					<ItemsPanelTemplate>
						<toolkit:WrapPanel ItemWidth="550" Margin="0"/>
					</ItemsPanelTemplate>
				</ItemsControl.ItemsPanel>
			</ItemsControl>
			<TextBlock x:Name="_WidgetsHeader" Text="Algemene Informatie" Style="{StaticResource TextBlockHeaderStyle}" />
			<ContentControl x:Name="_Widgets" Foreground="{StaticResource BorderForeground}">
			<StackPanel Orientation="Horizontal">
				<Border x:Name="wifi" Style="{StaticResource RoundedBorderStyleOuter}">
					<Border Style="{StaticResource RoundedBorderStyleInner}">
						<Grid>
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="200"/>
								<ColumnDefinition Width="80"/>
								<ColumnDefinition Width="257"/>
							</Grid.ColumnDefinitions>
							<Grid.RowDefinitions>
								<RowDefinition/>
								<RowDefinition/>
							</Grid.RowDefinitions>
							<Image Source="Images/WiFi Logo.png" Stretch="Uniform" Grid.RowSpan="2" Margin="10"/>
							<TextBlock Text="SSID:" Grid.Column="1" VerticalAlignment="Bottom" HorizontalAlignment="Right" Margin="5" TextAlignment="Right" FontWeight="Bold"/>
							<TextBlock Text="KEY:" Grid.Column="1" Grid.Row="1" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="5"  TextAlignment="Right" FontWeight="Bold"/>
							<TextBlock Text="{Binding WiFiSSID, FallbackValue=WLANFREE, Source={StaticResource Settings}}" Grid.Column="2" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="5" />
							<TextBlock Text="{Binding WiFiKey, FallbackValue=kenniscentrum, Source={StaticResource Settings}}" Grid.Column="2" Grid.Row="1" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="5" />
						</Grid>
					</Border>
				</Border>
				<Border x:Name="weather" Style="{StaticResource RoundedBorderStyleOuter}" DataContext="{Binding Source={StaticResource WeatherData}}">
					<Border Style="{StaticResource RoundedBorderStyleInner}">
						<Grid>
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="125"/>
								<ColumnDefinition Width="175"/>
								<ColumnDefinition Width="237"/>
							</Grid.ColumnDefinitions>
							
							<Image Source="{Binding IconPath, FallbackValue=Images/Weather/800.png}" Stretch="None"/>
								<StackPanel Grid.Column="1" VerticalAlignment="Center">
									<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
										<TextBlock Text="{Binding Temperature, FallbackValue=25, StringFormat=\{0:n0\}}" FontSize="64"/>
										<TextBlock Text="°" FontSize="64"/>
									</StackPanel>
									<TextBlock Text="{Binding City, FallbackValue=Veenendaal}" TextAlignment="Center" FontWeight="Bold"/>
								</StackPanel>
							<StackPanel Grid.Column="2" VerticalAlignment="Center">
                                <TextBlock Text="{Binding Condition, FallbackValue=Afwisselend hevige regenval en motregen}" VerticalAlignment="Bottom" Margin="5" TextWrapping="Wrap"/>
                                <TextBlock Text="{Binding Humidity, FallbackValue=0.456, StringFormat=Luchtvochtigheid: \{0:P0\}}" VerticalAlignment="Bottom" Margin="5"/>
                                <TextBlock VerticalAlignment="Bottom" Margin="5">
                                    <Run Text="Wind:"></Run>
                                    <Run Text="{Binding WindDirection, FallbackValue=90, Converter={StaticResource degreeToDirectionConverter}}"></Run>
                                    <Run Text="met"></Run>
                                    <Run Text="{Binding WindSpeed, FallbackValue=12.3, StringFormat=\{0:N0\}}"></Run>
                                    <Run Text="km/h"></Run>
                                </TextBlock>
							</StackPanel>
						</Grid>
					</Border>
				</Border>
			</StackPanel>
			</ContentControl>
			<TextBlock x:Name="_BlogsHeader" Text="Info Support Blogs (http://blogs.infosupport.com)" Style="{StaticResource TextBlockHeaderStyle}" />
			<ItemsControl x:Name="blogsItemsControl" ItemsSource="{Binding BlogPostCollection, Source={StaticResource BlogData}}" Foreground="{StaticResource BorderForeground}">
				<ItemsControl.ItemTemplate>
					<DataTemplate>
						<Border Style="{StaticResource RoundedBorderStyleOuter}">
							<Border Style="{StaticResource RoundedBorderStyleInner}">							
								<StackPanel Margin="25,10,10,10">
									<TextBlock Text="{Binding Title}"/>
									<TextBlock Text="{Binding Description}" Opacity="0.6" TextWrapping="Wrap"/>
								</StackPanel>
							</Border>
						</Border>
					</DataTemplate>					
				</ItemsControl.ItemTemplate>
			</ItemsControl>
		</StackPanel>
		<local:DigitalClockControl x:Name="clockControl" Canvas.Left="933" Canvas.Top="32" Height="126" Width="211" 
		Foreground="{StaticResource CurvesForeground}" Background="#25FFFFFF"  FontSize="26"/>
	</Canvas>
</UserControl>